package com.aeoj.clientmanagement.factory;


import com.aeoj.clientmanagement.service.CodeSandBoxService;
import com.aeoj.clientmanagement.service.impl.codesandbox.*;
import com.aeoj.clientmanagement.enums.judge.CodeSandBoxTypeEnum;

/**
 * 代码沙箱静态工厂
 * author: ZSM
 * time: 2025-03-01 18:43
 */
public class CodeSandBoxFactory {
    public static CodeSandBoxService createCodeSandBox(String type) {
        CodeSandBoxTypeEnum sandboxType = CodeSandBoxTypeEnum.fromValue(type);
        return switch (sandboxType) {
            case REMOTE -> new JavaDockerSandBox();
            case THIRD -> new ThirdSandBox();
            default -> new JavaNativeSandBox();
        };
    }
}
